package com.oracle.dao;

import com.oracle.beans.CheckGroup;
import com.oracle.beans.QueryPageVo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.SelectKey;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface CheckGroupMapper {

    List<CheckGroup> findList(QueryPageVo vo);

    @Insert("insert into t_checkgroup values(null,#{code},#{name},#{helpCode},#{sex}" +
            ",#{remark},#{attention}) ")
    @SelectKey(statement = "select last_insert_id()",keyProperty = "id",keyColumn = "id",
    before = false,resultType = Integer.class)
    Integer add(CheckGroup checkGroup);

    @Update("update t_checkgroup set code=#{code},name=#{name},helpCode=#{helpCode},sex=#{sex},remark=#{remark}," +
            "attention=#{attention} where id=#{id}")
    Integer update(CheckGroup checkGroup);

    @Delete("delete from t_checkgroup where id=#{id}")
    Integer delete(Integer id);
}
